package com.push.web.service.impl;

import java.util.List;
import com.push.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.push.web.mapper.BizCollectionMapper;
import com.push.web.domain.BizCollection;
import com.push.web.service.IBizCollectionService;

/**
 * 我的收藏Service业务层处理
 *
 * @author push
 * @date 2023-02-17
 */
@Service
public class BizCollectionServiceImpl implements IBizCollectionService
{
    @Autowired
    private BizCollectionMapper bizCollectionMapper;

    /**
     * 查询我的收藏
     *
     * @param id 我的收藏主键
     * @return 我的收藏
     */
    @Override
    public BizCollection selectBizCollectionById(Long id)
    {
        return bizCollectionMapper.selectBizCollectionById(id);
    }

    @Override
    public BizCollection selectBizCollectionByUserId(Long userId)
    {
        return bizCollectionMapper.selectBizCollectionByUserId(userId);
    }



    /**
     * 查询我的收藏列表
     *
     * @param bizCollection 我的收藏
     * @return 我的收藏
     */
    @Override
    public List<BizCollection> selectBizCollectionList(BizCollection bizCollection)
    {
        return bizCollectionMapper.selectBizCollectionList(bizCollection);
    }

    /**
     * 新增我的收藏
     *
     * @param bizCollection 我的收藏
     * @return 结果
     */
    @Override
    public int insertBizCollection(BizCollection bizCollection)
    {
        bizCollection.setCreateTime(DateUtils.getNowDate());
        return bizCollectionMapper.insertBizCollection(bizCollection);
    }

    /**
     * 修改我的收藏
     *
     * @param bizCollection 我的收藏
     * @return 结果
     */
    @Override
    public int updateBizCollection(BizCollection bizCollection)
    {
        return bizCollectionMapper.updateBizCollection(bizCollection);
    }

    /**
     * 批量删除我的收藏
     *
     * @param ids 需要删除的我的收藏主键
     * @return 结果
     */
    @Override
    public int deleteBizCollectionByIds(Long[] ids)
    {
        return bizCollectionMapper.deleteBizCollectionByIds(ids);
    }

    /**
     * 删除我的收藏信息
     *
     * @param id 我的收藏主键
     * @return 结果
     */
    @Override
    public int deleteBizCollectionById(Long id)
    {
        return bizCollectionMapper.deleteBizCollectionById(id);
    }
}
